﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using DLV.Utilities;

namespace DLV.Data.Entities
{
    public class TourController
    {
        public int InsertTour(TourInfo info)
        {
            return SQL.InsertTour(info.TourName,info.TourTypeId,info.GroupType,info.LocationBegin,info.Schedule,info.QuantityAdult,info.QuantityChild, info.BeginDate, info.EndDate,info.QuantityDay,info.QuantityNight, info.CreatedBy, info.CreatedDate, info.UpdatedBy, info.UpdatedDate, info.Status,info.Season,info.MartName, info.QuantityBaby);
        }
        public void UpdateTour(TourInfo info)
        {
            SQL.UpdateTour(info.TourId, info.TourName, info.TourTypeId, info.GroupType, info.LocationBegin, info.Schedule,info.QuantityAdult, info.QuantityChild, info.BeginDate, info.EndDate, info.QuantityDay, info.QuantityNight, info.CreatedBy, info.CreatedDate, info.UpdatedBy, info.UpdatedDate, info.Status, info.Season, info.MartName, info.QuantityBaby);
        }
        public void DeleteTour(TourInfo info)
        {
            DeleteTour(info.TourId);
        }
        public void DeleteTour(int tourId)
        {
            SQL.DeleteTour(tourId);
        }
        public TourInfo GetTour(int tourId)
        {
            return CBO.FillObject<TourInfo>(SQL.GetTour(tourId));
        }
        public List<TourInfo> ListTour()
        {
            return CBO.FillCollection<TourInfo>(SQL.ListTour());
        }
        public DataTable SelectTour()
        {
            return CBO.ConvertToDataTable(ListTour(), typeof(TourInfo));
        }
        public Dictionary<object, object> ListTourLookup()
        {
            var pages = ListTour();
            return pages.ToDictionary<TourInfo, object, object>(info => info.TourId, info => info.TourName);
        }
    }
}
